//
//  VehicleMaintenanceStepsCell.m
//  阿帕
//
//  Created 阿帕 on 2020/1/5.
//  Copyright © 2020 GCY. All rights reserved.
//

#import "VehicleMaintenanceStepsCell.h"
@interface VehicleMaintenanceStepsCell ()

@end

@implementation VehicleMaintenanceStepsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _vLineView.backgroundColor = Theme_ColorValue;
    cut(_stepNumLabel, 10);
    _stepNumLabel.backgroundColor = Theme_ColorValue;
}

- (void)setModel:(MaintainStepModel *)model {
    
    _model = model;
    
    _stepNumLabel.text = [NSString nullToString:CJStringWithFormat(@"%ld", model.applyStep+1)];
    
    NSString *applyStatus = @"";
    
    NSMutableArray *valueArr = @[
        applyStatus,
        [NSString nullToString:CJStringWithFormat(@"审批人:%@", model.applyRoleName)],
        [NSString nullToString:CJStringWithFormat(@"审核时间:%@", model.gmtModified)],
        [NSString stringWithFormat:@"备注:%@", [NSString nullToString:CJStringWithFormat(@"%@", model.remark)]],
    ].mutableCopy;
    
    if (model.applyStatus == 0) {
        applyStatus = @"待审核";
        [valueArr removeObjectAtIndex:2];
    } else if (model.applyStatus == 1) {
        applyStatus = @"已通过";
    } else if (model.applyStatus == 2) {
        applyStatus = @"已驳回";
    }
    
    for (int i=0; i<valueArr.count; i++) {
        UILabel *valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(_stepNumLabel.cy_right + 10, 30*i, 260, 30)];
        valueLabel.tag = 100+i;
        valueLabel.textColor = Light_TextColor;
        valueLabel.font = font(14);
        valueLabel.adjustsFontSizeToFitWidth = YES;
        [self.contentView addSubview:valueLabel];
        if (i==0) {
            valueLabel.textColor = Dark_TextColor;
        }
        valueLabel.text = valueArr[i];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
